package com.gaojx.lang.rule;

import com.gaojx.lang.form.ElementForm;
import com.gaojx.lang.form.TableViewForm;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author junxiang.gao
 * @since 2020/8/19
 */
@RestController
public class ApiController {

    private static final Logger LOGGER = LoggerFactory.getLogger(ApiController.class);

    @PostMapping(value = "/test")
    public String test() throws Exception {
        List<IRule> ruleList = RuleFactory.INSTANCE.getRuleList();
        for (IRule item : ruleList) {
            item.printInfo();
        }

        return "xxx";
    }

    @PostMapping(value = "/testType")
    public String testType(@RequestBody ElementForm form) {
        LOGGER.info("form : {}", form);
        return "testType";
    }
}
